<?php

/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
include APPLICATION_PATH . "/models/User.php";
include APPLICATION_PATH."/models/News.php";
include APPLICATION_PATH."/models/Agent.php";
class IndexController extends Zend_Controller_Action{
      public function init() {
        $bootstrap = $this->getInvokeArg("bootstrap");
        $this->aConfig = $bootstrap->getOptions();
        $this->view->aConfig = $this->aConfig;
        $this->modelMapper= new Model_UserMapper();
        $this->model= new Model_User();
        $this->Newsmodel=new Model_News();
        $this->NewsmodelMapper= new Model_NewsMapper();
        $this->Agentmodel=new Model_Agent();
        $this->AgentmodelMapper=new Model_AgentMapper();
    }
    public function indexAction(){
        $user=GlobalLib::getUserLogin();
        $id= $user['id'];
        $this->view->items=$this->NewsmodelMapper->publicpublished(1);
        $this->view->chargesbuy=$this->AgentmodelMapper->getChargesBuy($id);
        $this->view->chargessell=$this->AgentmodelMapper->getChargesSell($id);
    }
}